# -*- coding: utf-8 -*-
from db.mysql import MysqlClient
from common.helper import Helper
from itertools import product

name = "550万航空意外险"
mysql = MysqlClient()
plan = {
    "planA": {
        "days": ["1d"],
        "people_count": ["1"],
        "airplane_death": ["2000000"],
        "accident_medical": ["100000"],
        "price":["5.00"]

    },
    "planB": {
        "days": ["1d"],
        "people_count": ["1"],
        "airplane_death": ["2000000"],
        "accident_medical": ["100000"],
        "price":["10.00"]

    },
    "planC": {
        "days": ["1d"],
        "people_count": ["1"],
        "airplane_death": ["2000000"],
        "accident_medical": ["100000"],
        "price":["15.00"]

    },

}
for k in plan:
    for v in product(plan[k]["days"],plan[k]["people_count"],plan[k]["airplane_death"],plan[k]["accident_medical"],plan[k]["price"]):
        data = Helper.formatProductInfo( plan[k],v )
        data["name"] = name
        data["company"] = "中国人民保险"
        Helper.mergeTable(name,mysql,data )